1. Field of the Invention
The present invention relates to stereo-image processing apparatuses, and more particularly, to a stereo-image processing apparatus including a stereo-image taking means that takes a plurality of images from different viewpoints.
2. Description of the Related Art
A stereo-image processing apparatus is known. In the stereo-image processing apparatus, a plurality of images of the same object are taken from different viewpoints by a stereo-image taking means such as a pair of right and left cameras, corresponding pixel regions are found in the taken images by stereo matching, and a three-dimensional position of the object is determined by triangulation based on parallaxes of the pixel regions.
In stereo matching, for example, an image taken by one of a pair of cameras serves as a reference image and an image taken by the other camera serves as a comparative image to be compared with the reference image. Correspondingly to a pixel region having a predetermined number of pixels in the reference image, a similar pixel region in the comparative image that has a brightness characteristic closest to the brightness characteristic of the pixels in the pixel region of the reference image is extracted, and both pixel regions are correlated with each other.
In order to determine the three-dimensional position of the object by triangulation, a point (X, Y, Z) in real space and the coordinates (i, j) of a pixel in the reference image are uniquely correlated, for example, by coordinate transformation given by the following Expressions (1) to (3):X=CD/2+Z×PW×(i−IV)  (1)Y=CH+Z×PW×(j−JV)  (2)Z=CD/(PW×(dp−DP))  (3)where dp represents the parallax between the corresponding pixel regions in the reference image and the comparative image, a point just below the midpoint between the cameras is designated as the origin, the X-axis indicates the direction in which the cameras are connected, the Y-axis indicates the up-down direction, and the Z-axis indicates the front-rear direction.
Herein, CD represents the distance between the cameras, PW represents the viewing angle for one pixel, CH represents the mounting height of the cameras, and IV and JV respectively represent i and j coordinates of the point at infinity in the reference image in front of the cameras.
DP in Expression (3) is called a vanishing point parallax or an infinite distance corresponding point. In short, DP represents an offset value between the parallax dp between the corresponding pixel regions in the reference image and the comparative image, and the parallax determined so that the actual distance Z of the object in the pixel regions satisfies the condition of Expression (3). Hereinafter, this offset value DP will be referred to as a parallax offset value DP. The parallax offset value DP is determined when a pair of cameras are mounted in the stereo-image processing apparatus, and is fixed at the determined value.
However, the parallax offset value DP sometimes deviates with time, for example, when the optical axis of the camera deviates because of physical stress applied to the camera by mounting the camera by screwing or distortion of the apparatus having the camera due to vibration and heat. If the parallax offset value DP thus deviates, the parallax dp between the reference image and the comparative image does not precisely correspond to the actual distance Z of the object. This decreases the accuracy in determining the three-dimensional position of the object by the above-described stereo matching, and reduces reliability of obtained positional information such as the distance Z of the object.
As a method for correcting the deviation of the parallax offset value DP with time, it is conceivable to detect the deviation with a sensor or the like. Japanese Unexamined Patent Application Publication No. 2001-92968 proposes a stereo matching device that corrects deviation according to images of a screen, on which a plurality of numbered vertical lines are provided, taken by a pair of cameras, without using a sensor. Further, in a monitoring system proposed in Japanese Unexamined Patent Application Publication No. 2003-83742, vanishing points are calculated in images taken by a pair of cameras on the basis of images of white continuous and broken lines marked on the road surface and indoor straight lines such as boundary lines between the wall and the floor, and deviation is corrected on the basis of calculation result.
According to the methods discussed in the above-described publications, deviation of the parallax offset value DP with time can be corrected reliably.
Unfortunately, in the method discussed in Japanese Unexamined Patent Application Publication No. 2001-92968, it is troublesome to bring the screen and take an image of the screen in order to correct the parallax offset value DP. In contrast, in the method discussed in Japanese Unexamined Patent Application Publication No. 2003-83742, correction can be performed only in an environment where a linear object serving as a criterion for calculating the vanishing point, such as a straight traffic line and a linear boundary portion between the wall and floor, extends in front of a pair of cameras.